home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 October: Mac OS SDK / Dev.CD Oct 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / AIncludes / ConditionalMacros.a < prev    next >
Encoding:
Text File  |  1997-08-12  |  9.2 KB  |  246 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        ConditionalMacros.a
  3. ;
  4. ;    Contains:    Set up for compiler independent conditionals
  5. ;
  6. ;    Version:    Technology:    Universal Interface Files 3.0.1
  7. ;                Release:    Universal Interfaces 3.0.1
  8. ;
  9. ;    Copyright:    © 1993-1997 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__CONDITIONALMACROS__') = 'UNDEFINED' THEN
  19. __CONDITIONALMACROS__ SET 1
  20.  
  21. ; ****************************************************************************************************
  22. ;    UNIVERSAL_INTERFACES_VERSION
  23. ;    
  24. ;        0x0301 => version 3.0.1
  25. ;        0x0300 => version 3.0
  26. ;        0x0210 => version 2.1
  27. ;        This conditional did not exist prior to version 2.1
  28. ;***************************************************************************************************
  29.  
  30. UNIVERSAL_INTERFACES_VERSION EQU $0301
  31.  
  32. ; ****************************************************************************************************
  33. ;
  34. ;    TARGET_CPU_≈    
  35. ;    These conditionals specify which microprocessor instruction set is being
  36. ;    generated.  At most one of these is true, the rest are false.
  37. ;
  38. ;        TARGET_CPU_PPC            - Compiler is generating PowerPC instructions
  39. ;        TARGET_CPU_68K            - Compiler is generating 680x0 instructions
  40. ;        TARGET_CPU_X86            - Compiler is generating x86 instructions
  41. ;        TARGET_CPU_MIPS            - Compiler is generating MIPS instructions
  42. ;        TARGET_CPU_SPARC        - Compiler is generating Sparc instructions
  43. ;        TARGET_CPU_ALPHA        - Compiler is generating Dec Alpha instructions
  44. ;
  45. ;
  46. ;    TARGET_OS_≈    
  47. ;    These conditionals specify in which Operating System the generated code will
  48. ;    run. At most one of the these is true, the rest are false.
  49. ;
  50. ;        TARGET_OS_MAC            - Generate code will run under Mac OS
  51. ;        TARGET_OS_WIN32            - Generate code will run under 32-bit Windows
  52. ;        TARGET_OS_UNIX            - Generate code will run under some unix 
  53. ;
  54. ;
  55. ;    TARGET_RT_≈    
  56. ;    These conditionals specify in which runtime the generated code will
  57. ;    run. This is needed when the OS and CPU support more than one runtime
  58. ;    (e.g. MacOS on 68K supports CFM68K and Classic 68k).
  59. ;
  60. ;        TARGET_RT_LITTLE_ENDIAN    - Generated code uses little endian format for integers
  61. ;        TARGET_RT_BIG_ENDIAN    - Generated code uses big endian format for integers     
  62. ;        TARGET_RT_MAC_CFM        - TARGET_OS_MAC is true and CFM68K or PowerPC CFM being used    
  63. ;        TARGET_RT_MAC_68881        - TARGET_OS_MAC is true and 68881 floating point instructions used    
  64. ;
  65. ;
  66. ;    PRAGMA_≈
  67. ;    These conditionals specify whether the compiler supports particular #pragma's
  68. ;    
  69. ;        PRAGMA_IMPORT             - Compiler supports: #pragma import on/off/reset
  70. ;        PRAGMA_ONCE              - Compiler supports: #pragma once
  71. ;        PRAGMA_STRUCT_ALIGN      - Compiler supports: #pragma options align=mac68k/power/reset
  72. ;        PRAGMA_STRUCT_PACK        - Compiler supports: #pragma pack(n)
  73. ;        PRAGMA_STRUCT_PACKPUSH    - Compiler supports: #pragma pack(push, n)/pack(pop)
  74. ;        PRAGMA_ENUM_PACK         - Compiler supports: #pragma options(!pack_enums)
  75. ;        PRAGMA_ENUM_ALWAYSINT     - Compiler supports: #pragma enumsalwaysint on/off/reset
  76. ;        PRAGMA_ENUM_OPTIONS        - Compiler supports: #pragma options enum=int/small/reset
  77. ;
  78. ;    FOUR_CHAR_CODE
  79. ;    This conditional does the proper byte swapping to assue that a four character code (e.g. 'TEXT')
  80. ;    is compiled down to the correct value on all compilers.
  81. ;
  82. ;        FOUR_CHAR_CODE('abcd')    - Convert a four-char-code to the correct 32-bit value
  83. ;
  84. ;    TYPE_≈
  85. ;    These conditionals specify whether the compiler supports particular types.
  86. ;
  87. ;        TYPE_LONGLONG            - Compiler supports "long long" 64-bit integers
  88. ;        TYPE_BOOL                - Compiler supports "bool"
  89. ;        TYPE_EXTENDED            - Compiler supports "extended" 80/96 bit floating point
  90. ;
  91. ;***************************************************************************************************
  92.  
  93.  
  94.  
  95.     IF &TYPE('PowerAsm') <> 'UNDEFINED' THEN
  96.         ;
  97.         ;    PPCAsm PowerPC assembler from Apple Computer, Inc.    
  98.         ;
  99.         TARGET_CPU_68K:                SET     0
  100.         TARGET_CPU_PPC:                SET      1
  101.         TARGET_CPU_X86:                SET      0
  102.         TARGET_CPU_MIPS:            SET     0
  103.         TARGET_CPU_SPARC:            SET     0
  104.         TARGET_RT_MAC_CFM:            SET        1
  105.         TARGET_RT_MAC_68881:        SET        0
  106.         TARGET_OS_MAC:                SET        1
  107.         TARGET_OS_WIN32:            SET        0
  108.         TARGET_OS_UNIX:                SET        0
  109.         TARGET_RT_LITTLE_ENDIAN:    SET        0
  110.         TARGET_RT_BIG_ENDIAN:        SET        1
  111.         TYPE_EXTENDED:                SET        0
  112.         TYPE_LONGLONG:                SET        0
  113.         TYPE_BOOL:                    SET        0
  114.     ELSE
  115.         ;
  116.         ;    Asm 68K assembler from Apple Computer, Inc.    
  117.         ;
  118.         TARGET_CPU_68K:                SET     1
  119.         TARGET_CPU_PPC:                SET      0
  120.         TARGET_CPU_X86:                SET      0
  121.         TARGET_CPU_MIPS:            SET     0
  122.         TARGET_CPU_SPARC:            SET     0
  123.         IF (&TYPE('&SYSMODEL') <> 'UNDEFINED') AND (&SYSMODEL = '__CFM68K__') THEN
  124.             TARGET_RT_MAC_CFM:        SET     1    
  125.         ELSE
  126.             TARGET_RT_MAC_CFM:        SET     0    
  127.         ENDIF
  128.         IF &TYPE('FP0') = 'FPREG FP0' THEN
  129.             TARGET_RT_MAC_68881:    SET     1    
  130.         ELSE
  131.             TARGET_RT_MAC_68881:    SET     0    
  132.         ENDIF
  133.         TARGET_OS_MAC:                SET        1
  134.         TARGET_OS_WIN32:            SET        0
  135.         TARGET_OS_UNIX:                SET        0
  136.         TARGET_RT_LITTLE_ENDIAN:    SET        0
  137.         TARGET_RT_BIG_ENDIAN:        SET        1
  138.         TYPE_EXTENDED:                SET        1
  139.         TYPE_LONGLONG:                SET        0
  140.         TYPE_BOOL:                    SET        0
  141.     ENDIF
  142.  
  143.  
  144.  
  145.  
  146. ; ****************************************************************************************************
  147. ;    Backward compatibility for clients expecting 2.x version on ConditionalMacros.h
  148. ;
  149. ;    GENERATINGPOWERPC        - Compiler is generating PowerPC instructions
  150. ;    GENERATING68K            - Compiler is generating 68k family instructions
  151. ;    GENERATING68881            - Compiler is generating mc68881 floating point instructions
  152. ;    GENERATINGCFM            - Code being generated assumes CFM calling conventions
  153. ;    CFMSYSTEMCALLS            - No A-traps.  Systems calls are made using CFM and UPP's
  154. ;    PRAGMA_ALIGN_SUPPORTED    - Compiler supports: #pragma options align=mac68k/power/reset
  155. ;    PRAGMA_IMPORT_SUPPORTED    - Compiler supports: #pragma import on/off/reset
  156. ;
  157. ;***************************************************************************************************
  158.  
  159.     GENERATINGPOWERPC: SET TARGET_CPU_PPC
  160.     GENERATING68K: SET TARGET_CPU_68K
  161.     GENERATING68881: SET TARGET_RT_MAC_68881
  162.     GENERATINGCFM: SET TARGET_RT_MAC_CFM
  163.     CFMSYSTEMCALLS: SET TARGET_RT_MAC_CFM
  164. ;    NOTE: The FOR_≈ conditionals were developed to produce integerated
  165. ;          interface files for System 7 and Copland.  Now that Copland
  166. ;          is canceled, all FOR_ conditionals have been removed from
  167. ;          the interface files.  But, just in case you someone got an 
  168. ;          interface file that uses them, the following sets the FOR_≈
  169. ;          conditionals to a consistent, usable state.
  170. ;
  171.  
  172.     FOR_OPAQUE_SYSTEM_DATA_STRUCTURES: SET 0
  173.     IF &TYPE('FOR_PTR_BASED_AE') = 'UNDEFINED' THEN
  174.     FOR_PTR_BASED_AE: SET 0
  175.     ENDIF
  176.     FOR_SYSTEM7_ONLY: SET 1
  177.     FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED: SET 1
  178.     FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE: SET 1
  179.     FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE: SET 1
  180.     FOR_SYSTEM8_COOPERATIVE: SET 0
  181.     FOR_SYSTEM8_PREEMPTIVE: SET 0
  182.  
  183.  
  184.  
  185. ; ****************************************************************************************************
  186. ;
  187. ;    OLDROUTINENAMES            - "Old" names for Macintosh system calls are allowed in source code.
  188. ;                              (e.g. DisposPtr instead of DisposePtr). The names of system routine
  189. ;                              are now more sensitive to change because CFM binds by name.  In the 
  190. ;                              past, system routine names were compiled out to just an A-Trap.  
  191. ;                              Macros have been added that each map an old name to its new name.  
  192. ;                              This allows old routine names to be used in existing source files,
  193. ;                              but the macros only work if OLDROUTINENAMES is true.  This support
  194. ;                              will be removed in the near future.  Thus, all source code should 
  195. ;                              be changed to use the new names! You can set OLDROUTINENAMES to false
  196. ;                              to see if your code has any old names left in it.
  197. ;    
  198. ;    OLDROUTINELOCATIONS     - "Old" location of Macintosh system calls are used.  For example, c2pstr 
  199. ;                              has been moved from Strings to TextUtils.  It is conditionalized in
  200. ;                              Strings with OLDROUTINELOCATIONS and in TextUtils with !OLDROUTINELOCATIONS.
  201. ;                              This allows developers to upgrade to newer interface files without 
  202. ;                              having to change the includes in their source code.  But, it allows
  203. ;                              the slow migration of system calls to more understandable file locations.  
  204. ;                              OLDROUTINELOCATIONS currently defaults to true, but eventually will 
  205. ;                              default to false.
  206. ;
  207. ;***************************************************************************************************
  208.  
  209.     IF &TYPE('OLDROUTINENAMES') = 'UNDEFINED' THEN
  210.     OLDROUTINENAMES: SET 0
  211.     ENDIF
  212.     IF &TYPE('OLDROUTINELOCATIONS') = 'UNDEFINED' THEN
  213.     OLDROUTINELOCATIONS: SET 0
  214.     ENDIF
  215.  
  216. ;****************************************************************************************************
  217. ;    IMPORT_CFM_FUNCTION     -    Macro used instead of IMPORT pseduo opcode because PowerPC
  218. ;                                and 68K CFM runtimes differ on naming of imported functions.
  219. ;                                PowerPC requires a period (.) in front of the name and CFM 68K
  220. ;                                does not.  This macros supplies the period for PowerPC.
  221. ;***************************************************************************************************
  222.  
  223.     IF TARGET_RT_MAC_CFM THEN
  224.         IF TARGET_CPU_PPC THEN
  225.             Macro
  226.             IMPORT_CFM_FUNCTION        &functionName
  227.             IMPORT                    .&functionName
  228.             EndM
  229.         ELSE
  230.             Macro
  231.             IMPORT_CFM_FUNCTION        &functionName
  232.             IMPORT                    &functionName
  233.             EndM
  234.         ENDIF    ; TARGET_OS_PPC
  235.     ENDIF    ; TARGET_RT_MAC_CFM
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.     ENDIF ; __CONDITIONALMACROS__ 
  244.  
  245.